import 'mars3d-cesium/Build/Cesium/Widgets/widgets.css'
import * as Cesium from 'mars3d-cesium'
import 'mars3d/dist/mars3d.css'
import * as mars3d from 'mars3d'
import 'mars3d-space'
import { mapOptions } from './config/Map'

interface MapType {
  map: Object | null
}

export default function (target) {
  const mapObj: MapType = {
    map: null
  }
  const initMap = (callBack: Function) => {
    mapObj.map = new mars3d.Map(target, mapOptions)
    if (callBack) {
      callBack(mapObj.map)
    }
  }

  return {
    initMap
  }
}
